]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm: Do not fail the whole authentication if a background service failed
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 2 Feb 2021 15:30:11 +0000 (16:30 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 12 Feb 2021 20:26:00 +0000 (20:26 +0000)
In case a background service such as the fingerprint authentication
fails to start we'd just mark the whole authentication process as
failed.

Currently this may happen by just putting a wrong password when an user
has some fingerprints enrolled, the fingerprint gdm authentication
worker may take some time to restart leading to a failure and this is
currently also making the password authentication to fail:

    JS ERROR: Failed to start gdm-fingerprint for u: Gio.DBusError:
        GDBus.Error:org.freedesktop.DBus.Error.Spawn.Failed:
            Could not create authentication helper process
        _promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:435:45
        ### Promise created here: ###
        _startService@resource:///org/gnome/shell/gdm/util.js:470:42
        _beginVerification@resource:///org/gnome/shell/gdm/util.js:495:18
        _getUserVerifier@resource:///org/gnome/shell/gdm/util.js:405:14
        async*_openReauthenticationChannel@resource:///org/gnome/shell/gdm/util.js:378:22
        async*begin@resource:///org/gnome/shell/gdm/util.js:194:18
        _retry@resource:///org/gnome/shell/gdm/util.js:561:14
        _verificationFailed/signalId<@resource:///org/gnome/shell/gdm/util.js:584:30
        _emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
        finishMessageQueue@resource:///org/gnome/shell/gdm/util.js:268:14
        _queueMessageTimeout@resource:///org/gnome/shell/gdm/util.js:273:18
        _queueMessageTimeout/this._messageQueueTimeoutId<@resource:///org/gnome/shell/gdm/util.js:288:65

Given that background services are ignored even for queries or any kind
of message, we should not fail the authentication request unless the
default service fails.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1622>

js/gdm/util.js

index 587a2c94155d9234c75dd44d9c21955d1710af15..0465609195138ef5ca6d3ab436de264e8a7a9422 100644 (file)
@@ -501,6 +501,11 @@ var ShellUserVerifier = class {
         } catch (e) {
             if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                 return;
+            if (!this.serviceIsForeground(serviceName)) {
+                logError(e, 'Failed to start %s for %s'.format(serviceName, this._userName));
+                this._hold.release();
+                return;
+            }
             this._reportInitError(this._userName
                 ? 'Failed to start verification for user'
                 : 'Failed to start verification', e);